From: Florian Müllner Date: Wed, 17 Feb 2021 19:31:33 +0000 (+0100) Subject: workspaceThumbnail: Base n-workspaces on number of thumbs X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~284 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bf8e76217819a971b719ae331d125b372ce4d75f;p=gnome-shell.git workspaceThumbnail: Base n-workspaces on number of thumbs It's what we base our size request on, and what we actually allocate. The difference usually doesn't matter right now, but will soon when we animate the minimap itself. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3739 Part-of: --- diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index 8d3cb53d1..ad8dfbf53 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -1257,9 +1257,7 @@ var ThumbnailsBox = GObject.registerClass({ if (this._thumbnails.length == 0) // not visible return; - let workspaceManager = global.workspace_manager; let themeNode = this.get_theme_node(); - box = themeNode.get_content_box(box); const portholeWidth = this._porthole.width; @@ -1267,7 +1265,7 @@ var ThumbnailsBox = GObject.registerClass({ const spacing = themeNode.get_length('spacing'); // Compute the scale we'll need once everything is updated - let nWorkspaces = workspaceManager.n_workspaces; + const nWorkspaces = this._thumbnails.length; let totalSpacing = (nWorkspaces - 1) * spacing; const availableWidth = (box.get_width() - totalSpacing) / nWorkspaces;